<?php
namespace app\common\model;

class Task extends Base
{
    protected $name = 'task';

    public function getFinishTimeAttr($val)
    {
        if(!$val){
            return '-';
        }

        $time = $val - time();

        if($time <= 0){
            return -1;
        }else{
            return $time;
        }
    }
}